/**
 * 
 */
package com.misoo.ex05;

/**
 * @author daniel.chai
 *
 */
public class DataModel {
	private String[] data, xdata;
	private double[] price;
	private boolean k = true;
	
	public DataModel(){
		data = new String[3];
		data[0] = "Item-1";
		data[1] = "Item-2";
		data[2] = "Item-3";
		
		xdata = new String[3];
		xdata[0] = "Prod-x";
		xdata[1] = "Prod-y";
		xdata[2] = "Prod-x";
		
		price = new double[3];
		price[0] = 305.5;
		price[1] = 56.75;
		price[2] = 100.25;
	}
	
	public String[] loadData(){
		k = !k ;
		if(k) 
			return xdata;
		else
			return data;
	}
	
	public double getPrice(int i){
		return price[i];
	}
}
